<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddColumnStatusInTimeLogTable extends AbstractMigration
{
    public function up()
    {
        $this->table('timelog')
            ->addColumn('correct_start_time', 'integer', ['signed' => false, 'default' => 0, 'limit' => 11, 'comment' => '修正的开始时间'])
            ->addColumn('correct_end_time', 'integer', ['signed' => false, 'default' => 0, 'limit' => 11, 'comment' => '修正的结束时间'])
            ->addColumn('work_time_status', 'enum', ['values' => 'normal,outside', 'default' => 'normal', 'comment' => '工作时间状态(normal 正常时间内,outside 正常时间外)'])
            ->save();
    }

    public function down()
    {
        $this->table('timelog')
            ->removeColumn('correct_start_time')
            ->removeColumn('correct_end_time')
            ->removeColumn('work_time_status')
            ->save();
    }
}
